package com.jk.blog.entity.enumType;

/**
 * Created by Auser on 2016/10/18.
 */
public enum CommentType {
    ARTICLE(1, "主题评论"),
    COMMENT(2, "评论回复");

    private int code;
    private String name;

    CommentType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(int code){
        for(CommentType c : CommentType.values()){
            if(c.getCode() == code)
                return c.getName();
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
